<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }
    body {
      background-color: black;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;;
    }
    .card {
        width: 200px;
        height: 100px;
        position: relative;
        border-radius: 10px;
        transition: all .3s;
        color: #ffffff;
        text-align: center;
        line-height: 100px;
        font-size: 28px;
    }
    .card::before, .card::after {
      content: "";
      position: absolute;
      top: -10px;
      left: -10px;
      right: -10px;
      bottom: -10px;
      border: 2px solid #ffffff;
      transition: all .5s;
      border-radius: 10px;
      animation: clippath 3s infinite linear;
    }
    .card::after {
      animation: clippath 3s infinite -1.5s linear;
    }
    @keyframes clippath {
      0%, 100% { clip-path: inset(0 0 98% 0); }
      25% { clip-path: inset(0 98% 0 0); }
      50% { clip-path: inset(98% 0 0 0); }
      75% { clip-path: inset(0 0 0 98%); }
    }
  </style>
</head>
<body>
  <div class="card">
    转动的边框线
  </div>
</body>
</html>